{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 996 小调查"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import sys\n",
    "sys.path.append(\"..\")\n",
    "sys.path.append(\"../py\")\n",
    "import pandas as pd\n",
    "import numpy as np\n",
    "import db\n",
    "import inspect\n",
    "import matplotlib.pyplot as plt\n",
    "import scipy.stats as stats\n",
    "%matplotlib inline"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "conn=db.get_conn()\n",
    "data_996 = pd.read_sql(sql=\"select * from _201904 where icu_996=1 and monthly_salary>0 and monthly_salary<300000 order by company_title\", con=conn)\n",
    "data_non_996 = pd.read_sql(sql=\"select * from _201904 where non_996=1 and monthly_salary>0 and monthly_salary<300000 order by company_title\", con=conn)\n",
    "sql_count=\"select COUNT(1)  from _201904 where monthly_salary>0 and monthly_salary<300000\"\n",
    "count=conn.execute(sql_count).fetchall()[0][0]\n",
    "conn.close()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 996有多严重"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "总共有效程序员招聘数据139,688条。\n",
      "其中996公司共15,675家，占11.2%。\n",
      "非996公司共30,521家，占21.8%。\n",
      "无法确定是否996的公司占所有公司的比例为66.9%。\n"
     ]
    }
   ],
   "source": [
    "print('总共有效程序员招聘数据{0:,}条。'.format(count))\n",
    "print('其中996公司共{0:,}家，占{1:.1%}。'.format(data_996.shape[0], data_996.shape[0]/count))\n",
    "print('非996公司共{0:,}家，占{1:.1%}。'.format(data_non_996.shape[0], data_non_996.shape[0]/count))\n",
    "print('无法确定是否996的公司占所有公司的比例为{0:.1%}。'.format(1-(data_996.shape[0]+data_non_996.shape[0])/count))"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "因为有66%的公司情况未知，所以单单根据数据无法判断996现象有多严重。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 名单"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [],
   "source": [
    "blacklist=data_996.company_title.unique()\n",
    "with open('stats/blacklist.md',mode='w', encoding='utf-8') as f:\n",
    "    f.write(\"# 996公司黑名单：\\n\\n\\n\")\n",
    "    for company in blacklist:\n",
    "        f.write(company+\"\\n\\n\")\n",
    "    f.flush()\n",
    "    f.close()\n",
    "whitelist=data_non_996.company_title.unique()\n",
    "with open('docs/index.html',mode='w', encoding='utf-8') as f:\n",
    "    f.write(\"<pre>\\n\")\n",
    "    f.write(\"955公司白名单：\\n\\n\\n\")\n",
    "    for company in whitelist:\n",
    "        f.write(company+\"\\n\")\n",
    "    f.write(\"</pre>\\n\")\n",
    "    f.flush()\n",
    "    f.close()\n",
    "    \n",
    "with open('stats/whitelist.md',mode='w', encoding='utf-8') as f:\n",
    "\n",
    "    f.write(\"# 955公司白名单：\\n\\n\\n\")\n",
    "    f.write(\"白名单生成源代码：\\n\\nhttps://github.com/juwikuang/china_job_survey\\n\\n\\n\")\n",
    "    f.write(\"一下公司在招聘网站是自称是双休，或者朝九晚五，所以上了白名单。如果有不实信息的，请提高证据，我会删除名单中的这家公司。\\n\\n\")\n",
    "    f.write(\"本名单不关心公司是否有违法劳动法内容。至少不是996公司，都值得表扬。\\n\\n\")\n",
    "    for company in whitelist:\n",
    "        f.write(company+\"\\n\\n\")\n",
    "\n",
    "    f.flush()\n",
    "    f.close()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 工资"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 23,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "996公司的平均工资为15344\n",
      "非996公司的平均工资为12210\n",
      "996公司的工资比非996公司高25.7%\n"
     ]
    }
   ],
   "source": [
    "mean_996=data_996.monthly_salary.mean() * 10000\n",
    "print('996公司的平均工资为{0:.0f}'.format(mean_996))\n",
    "mean_non_996=data_non_996.monthly_salary.mean() * 10000\n",
    "print('非996公司的平均工资为{0:.0f}'.format(mean_non_996))\n",
    "compare_percentage=(mean_996-mean_non_996)*100/mean_non_996\n",
    "print('996公司的工资比非996公司高{:.1f}%'.format(compare_percentage))"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "F_onewayResult(statistic=1079.1818449074656, pvalue=5.547267716423656e-234)"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#oneway anova test\n",
    "stats.f_oneway(data_996.monthly_salary, data_non_996.monthly_salary)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "统计显示，996公司的平均工资【显著地】比非996公司高。\n",
    "\n",
    "毕竟，现在是市场经济，人员都是自由流动的。又要别人996，又不多给钱，可能么？\n",
    "\n",
    "是不是要996，是不是要多拿26%的工资，请君自便。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 什么样的公司是996的？"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [],
   "source": [
    "del data_996['publish_date']\n",
    "del data_996['published_on_weekend']\n",
    "del data_996['title']\n",
    "del data_996['company_title']\n",
    "del data_996['company_description']\n",
    "del data_996['job_description']\n",
    "del data_996['job_id']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [],
   "source": [
    "del data_non_996['publish_date']\n",
    "del data_non_996['published_on_weekend']\n",
    "del data_non_996['title']\n",
    "del data_non_996['company_title']\n",
    "del data_non_996['company_description']\n",
    "del data_non_996['job_description']\n",
    "del data_non_996['job_id']"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "data_996_sum=data_996.sum()\n",
    "data_non_996_sum=data_non_996.sum()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [],
   "source": [
    "def get_subset(data_sum, prefix):\n",
    "    features = [feature for feature in data_996.columns if feature.startswith(prefix)]\n",
    "    sub_set = data_sum[features]\n",
    "    return sub_set\n",
    "\n",
    "def get_subset_percentage(data_sum, prefix):\n",
    "    sub_set=get_subset(data_sum, prefix)\n",
    "    count_all=sub_set.sum()\n",
    "    sub_set_percentage=sub_set/count_all\n",
    "    return sub_set_percentage\n",
    "\n",
    "def get_compare(data_996_sum, data_non_996_sum, prefix):\n",
    "    data_996_percentage = get_subset_percentage(data_996_sum, prefix)\n",
    "    data_non_996_percentage = get_subset_percentage(data_non_996_sum, prefix)\n",
    "    data_compare=pd.DataFrame()\n",
    "    data_compare['996']=data_996_percentage\n",
    "    data_compare['non_996']=data_non_996_percentage\n",
    "    #乘以100，会看得更清楚\n",
    "    data_compare = round(data_compare * 100,1)\n",
    "    return data_compare"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 公司性质"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 14,
   "metadata": {
    "scrolled": true
   },
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>996</th>\n",
       "      <th>non_996</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>company_type_foreign</th>\n",
       "      <td>3.1</td>\n",
       "      <td>4.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>company_type_foreign_gov</th>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>company_type_foreign_rep</th>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>company_type_listed</th>\n",
       "      <td>9.8</td>\n",
       "      <td>8.6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>company_type_non_profit</th>\n",
       "      <td>0.1</td>\n",
       "      <td>0.1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>company_type_private</th>\n",
       "      <td>70.1</td>\n",
       "      <td>77.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>company_type_public_institution</th>\n",
       "      <td>0.6</td>\n",
       "      <td>0.4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>company_type_startup</th>\n",
       "      <td>2.5</td>\n",
       "      <td>2.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>company_type_state</th>\n",
       "      <td>6.6</td>\n",
       "      <td>4.4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>company_type_us_eu</th>\n",
       "      <td>7.2</td>\n",
       "      <td>2.9</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                                  996  non_996\n",
       "company_type_foreign              3.1      4.0\n",
       "company_type_foreign_gov          0.0      0.0\n",
       "company_type_foreign_rep          0.0      0.0\n",
       "company_type_listed               9.8      8.6\n",
       "company_type_non_profit           0.1      0.1\n",
       "company_type_private             70.1     77.5\n",
       "company_type_public_institution   0.6      0.4\n",
       "company_type_startup              2.5      2.0\n",
       "company_type_state                6.6      4.4\n",
       "company_type_us_eu                7.2      2.9"
      ]
     },
     "execution_count": 14,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "get_compare(data_996_sum, data_non_996_sum, 'company_type_')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "公司性质看不出显著差异。其实，真正的外企都是双休的，但是，很多外企其实是中国人开的。统计的时候只能统计为外企。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 公司规模"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>996</th>\n",
       "      <th>non_996</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>company_size_10000</th>\n",
       "      <td>15.0</td>\n",
       "      <td>2.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>company_size_1000_5000</th>\n",
       "      <td>13.0</td>\n",
       "      <td>9.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>company_size_150_500</th>\n",
       "      <td>17.4</td>\n",
       "      <td>25.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>company_size_50</th>\n",
       "      <td>19.3</td>\n",
       "      <td>18.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>company_size_5000_10000</th>\n",
       "      <td>2.3</td>\n",
       "      <td>1.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>company_size_500_1000</th>\n",
       "      <td>7.5</td>\n",
       "      <td>8.6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>company_size_50_150</th>\n",
       "      <td>25.5</td>\n",
       "      <td>35.3</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                          996  non_996\n",
       "company_size_10000       15.0      2.0\n",
       "company_size_1000_5000   13.0      9.2\n",
       "company_size_150_500     17.4     25.3\n",
       "company_size_50          19.3     18.2\n",
       "company_size_5000_10000   2.3      1.5\n",
       "company_size_500_1000     7.5      8.6\n",
       "company_size_50_150      25.5     35.3"
      ]
     },
     "execution_count": 15,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "get_compare(data_996_sum, data_non_996_sum, 'company_size_')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "数据显示，10000人以上的大公司，更倾向于996。但是，这个可能是统计方法照成的。从996.icu收集到的996公司，很多都是大公司。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 公司行业"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>996</th>\n",
       "      <th>non_996</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>industry_ads</th>\n",
       "      <td>1.4</td>\n",
       "      <td>2.4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>industry_computer</th>\n",
       "      <td>72.8</td>\n",
       "      <td>69.7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>industry_edu</th>\n",
       "      <td>6.2</td>\n",
       "      <td>6.4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>industry_energy</th>\n",
       "      <td>1.9</td>\n",
       "      <td>2.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>industry_finance</th>\n",
       "      <td>3.5</td>\n",
       "      <td>3.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>industry_gov</th>\n",
       "      <td>1.5</td>\n",
       "      <td>2.4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>industry_logistic</th>\n",
       "      <td>1.3</td>\n",
       "      <td>1.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>industry_medical</th>\n",
       "      <td>2.4</td>\n",
       "      <td>2.9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>industry_realestate</th>\n",
       "      <td>1.8</td>\n",
       "      <td>2.1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>industry_service</th>\n",
       "      <td>0.9</td>\n",
       "      <td>0.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>industry_trade</th>\n",
       "      <td>6.4</td>\n",
       "      <td>6.6</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                      996  non_996\n",
       "industry_ads          1.4      2.4\n",
       "industry_computer    72.8     69.7\n",
       "industry_edu          6.2      6.4\n",
       "industry_energy       1.9      2.0\n",
       "industry_finance      3.5      3.3\n",
       "industry_gov          1.5      2.4\n",
       "industry_logistic     1.3      1.2\n",
       "industry_medical      2.4      2.9\n",
       "industry_realestate   1.8      2.1\n",
       "industry_service      0.9      0.8\n",
       "industry_trade        6.4      6.6"
      ]
     },
     "execution_count": 16,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "get_compare(data_996_sum, data_non_996_sum, 'industry_')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "996和非996公司并没有明显的行业分布差异。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 城市分布"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 17,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>996</th>\n",
       "      <th>non_996</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>city_beijing</th>\n",
       "      <td>20.8</td>\n",
       "      <td>6.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>city_changchun</th>\n",
       "      <td>0.4</td>\n",
       "      <td>0.6</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>city_changsha</th>\n",
       "      <td>2.4</td>\n",
       "      <td>3.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>city_chengdu</th>\n",
       "      <td>3.9</td>\n",
       "      <td>5.5</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>city_chongqing</th>\n",
       "      <td>1.5</td>\n",
       "      <td>2.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>city_dalian</th>\n",
       "      <td>1.7</td>\n",
       "      <td>1.7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>city_dongguan</th>\n",
       "      <td>1.0</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>city_fuzhou</th>\n",
       "      <td>1.2</td>\n",
       "      <td>2.1</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>city_guangzhou</th>\n",
       "      <td>10.2</td>\n",
       "      <td>16.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>city_hangzhou</th>\n",
       "      <td>5.9</td>\n",
       "      <td>5.7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>city_harbin</th>\n",
       "      <td>0.4</td>\n",
       "      <td>1.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>city_hefei</th>\n",
       "      <td>1.5</td>\n",
       "      <td>3.2</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>city_jinan</th>\n",
       "      <td>1.0</td>\n",
       "      <td>1.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>city_kuming</th>\n",
       "      <td>0.4</td>\n",
       "      <td>1.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>city_nanjing</th>\n",
       "      <td>4.1</td>\n",
       "      <td>4.9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>city_ningbo</th>\n",
       "      <td>0.8</td>\n",
       "      <td>1.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>city_qingdao</th>\n",
       "      <td>0.7</td>\n",
       "      <td>1.4</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>city_shanghai</th>\n",
       "      <td>19.2</td>\n",
       "      <td>12.9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>city_shenyang</th>\n",
       "      <td>0.6</td>\n",
       "      <td>1.7</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>city_shenzhen</th>\n",
       "      <td>13.5</td>\n",
       "      <td>12.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>city_tianjin</th>\n",
       "      <td>0.7</td>\n",
       "      <td>0.8</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>city_wuhan</th>\n",
       "      <td>5.0</td>\n",
       "      <td>7.3</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>city_xian</th>\n",
       "      <td>1.8</td>\n",
       "      <td>2.9</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>city_zhengzhou</th>\n",
       "      <td>1.1</td>\n",
       "      <td>2.7</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "                 996  non_996\n",
       "city_beijing    20.8      6.5\n",
       "city_changchun   0.4      0.6\n",
       "city_changsha    2.4      3.3\n",
       "city_chengdu     3.9      5.5\n",
       "city_chongqing   1.5      2.2\n",
       "city_dalian      1.7      1.7\n",
       "city_dongguan    1.0      1.0\n",
       "city_fuzhou      1.2      2.1\n",
       "city_guangzhou  10.2     16.2\n",
       "city_hangzhou    5.9      5.7\n",
       "city_harbin      0.4      1.2\n",
       "city_hefei       1.5      3.2\n",
       "city_jinan       1.0      1.3\n",
       "city_kuming      0.4      1.0\n",
       "city_nanjing     4.1      4.9\n",
       "city_ningbo      0.8      1.3\n",
       "city_qingdao     0.7      1.4\n",
       "city_shanghai   19.2     12.9\n",
       "city_shenyang    0.6      1.7\n",
       "city_shenzhen   13.5     12.8\n",
       "city_tianjin     0.7      0.8\n",
       "city_wuhan       5.0      7.3\n",
       "city_xian        1.8      2.9\n",
       "city_zhengzhou   1.1      2.7"
      ]
     },
     "execution_count": 17,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "get_compare(data_996_sum, data_non_996_sum, 'city_')"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "数据显示，北京的程序员，更倾向于996。（20%对7%）\n",
    "\n",
    "恭喜帝都上了996黑名单"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.1"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
